<table border="1">
  <tr>
    <th>专辑名称</th>
    <th>视频总数</th>
    <th>所有者</th>
    <th>创建时间</th>
  </tr>

<% @albums.each do |album| %>
  <tr>
    <td><%= link_to album.title, album %></td>
    <td style="text-align:center"><%= album.movies.size.to_s %></td>
    <td ><%= link_to album.user.uname, album.user %></td>
    <td style="text-align:center"><%= album.created_at.strftime("%m-%d") %></td>
<% if current_user && current_user.id == album.user_id %>
    <td><%= link_to "上传新视频", "/movies/upload/#{album.id}" %></td>
<% end %>
<% if current_user && current_user.privilege > 1%>
    <td><%= link_to '删除', album, :confirm => 'Are you sure?', :method => :delete %></td>
<% end %>
  </tr>
<% end %>
</table>
